#include <fftw3.h>
#include <iostream>
#include <complex.h>
using namespace std;


int main(int argc, char* argv[])
{
  	int N = 10;
    fftw_complex *in, *out;
    fftw_plan p;
    in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
    out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
    p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);

	for(int i = 0; i < N; i++)
	{
	  in[i][0] = 1.0;
	  in[i][1] = 0.0;
	}
    fftw_execute(p); /* repeat as needed */
	for(int i = 0; i < N; i++)
	{
	  cout<< "(" << out[i][0] << "," << out[i][1] << ")\t";
	}
	cout << endl;
    fftw_destroy_plan(p);

	fftw_complex a, b, c;
	a[0] = 1;
	a[1] = 0;
	b[0] = 1;
	b[1] = 0;
	c = a * b;	
	cout << c[0] << c[1] << endl;
    fftw_free(in); fftw_free(out);
}

